/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package org.myorg.shr.gui.swg.display.panel;

import java.awt.event.ActionListener;
import javax.swing.Action;
import javax.swing.GroupLayout;
import javax.swing.JButton;
import org.myorg.shr.gui.swg.display.button.BtnIcnApply;
import org.myorg.shr.gui.swg.display.button.BtnIcnCancel;
import org.myorg.shr.gui.swg.display.button.BtnIcnOk;

/**
 *
 * @author Hatsites
 *
 * email: Hatsites_AT_gmail.com
 * ... please remove "_AT_" from the above string to get the right email address
 */

public class PnlCmdIcn extends PnlAbs {

 public PnlCmdIcn(ActionListener lst)
    {
        super();
        _btnCancel_ = new BtnIcnCancel(lst);
        _btnOk_ = new BtnIcnOk(lst);
        _btnApply_ = new BtnIcnApply(lst);
    }

    public PnlCmdIcn(Action actCancel, Action actOk, Action actApply)
    {
        super();
        _btnCancel_ = new BtnIcnCancel(actCancel);
        _btnOk_ = new BtnIcnOk(actOk);
        _btnApply_ = new BtnIcnApply(actApply);
    }

    public boolean init() {
        GroupLayout jPanel1Layout = new GroupLayout(this);
        this.setLayout(jPanel1Layout);


        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addGap(PnlCmdIcn._BUTTON_SPACEMENT_)
                .addComponent(_btnOk_, BtnIcnOk.BTN_SIZE, BtnIcnOk.BTN_SIZE, BtnIcnOk.BTN_SIZE)
                .addGap(PnlCmdIcn._BUTTON_SPACEMENT_)
                .addComponent(_btnApply_, BtnIcnApply.BTN_SIZE, BtnIcnApply.BTN_SIZE, BtnIcnApply.BTN_SIZE)
                .addGap(PnlCmdIcn._BUTTON_SPACEMENT_)
                .addComponent(_btnCancel_, BtnIcnCancel.BTN_SIZE, BtnIcnCancel.BTN_SIZE, BtnIcnCancel.BTN_SIZE)
                .addGap(PnlCmdIcn._BUTTON_SPACEMENT_))
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                .addComponent(_btnApply_)
                .addGap(20, 20, 20)
                .addComponent(_btnOk_)
                .addGap(20, 20, 20)
                .addComponent(_btnCancel_)
                .addGap(20, 20, 20))
        );
        return true;
    }

    public void destroy() {
        return;
    }

    final private static int _BUTTON_SPACEMENT_ = 3;

    private JButton _btnCancel_;
    private JButton _btnOk_;
    private JButton _btnApply_;
}
